import Vue from "vue/dist/vue.runtime"
import App from "./app.vue"
//import VueLazyload from 'vue-lazyload' 
import { Header,Swipe, SwipeItem,Button,Loadmore,Spinner,Lazyload  } from 'mint-ui';
import routes from "./router.js"
import VueRouter from "vue-router"
import VueResource from "vue-resource"
import chy_comment from "./component/common/comment.vue"
import VuePreview from 'vue2-preview'
import cust_filters from "./filters.js"


import 'mint-ui/lib/style.css';
import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'
import './lib/mui/css/app.css'


Vue.use(VueRouter)
Vue.use(VueResource)
//Vue.use(VueLazyload)
Vue.use(Lazyload);
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem);
Vue.component(Header.name, Header);
Vue.component(Loadmore.name, Loadmore);
Vue.component("chy-comment",chy_comment);
Vue.component(Button.name, Button);
Vue.component(Spinner.name, Spinner);
Vue.use(VuePreview)


let hostName = window.location.hostname;
hostName = "192.168.2.139"
Vue.http.options.root = "//"+hostName+":9888";
//Vue.http.headers.common['Access-Control-Allow-Origin'] = '*';
Vue.http.options.emulateJSON = true;
let router = new VueRouter({
    routes,
    linkActiveClass:"mui-active"
});


for(let cust_filter in cust_filters){
    let value = cust_filters[cust_filter]
    Vue.filter(cust_filter,value)
}


var v = new Vue({
    el:".app",
    render:c=>c(App),
    router:router
});

